<?php
GLOBAL $CFG;
GLOBAL $DB;
GLOBAL $USER;
define('AJAX_SCRIPT', true);
require_once('../../../config.php');
require_once('../lib.php');

$key = required_param('key', PARAM_TEXT);
$survey = required_param('numb', PARAM_TEXT);
$curSession = $USER->sesskey;

$mylib = new survey_management();

if($key == $curSession){
    $mylib->delete_survey($survey);
}